home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 36 / vfos_dv.zip / INSTALL.INC < prev    next >
Text File  |  1988-10-26  |  5KB  |  121 lines

  1.         subttl Installation routine
  2.         page +
  3.  
  4. ;
  5. ; VFOS_IBM FOSSIL driver by Bob Hartman  (SysOp of 1:132/101).
  6. ; Copyright 1988 by Spark Software.  ALL RIGHTS RESERVED.
  7. ;* all comments with * in them were added by David Page
  8. ;* and may not reflect Bob Hartman's intentions
  9. ;
  10. Resend  Equ     $                         ;Resident code ends here
  11.  
  12. my_intro Db      'VFOS_IBM VFOSSIL Compatible Driver '
  13.  
  14. rev_str db    '$Revision: ',curr_fossil+'0','.',curr_maj_rev+'0',curr_min_rev+'0',' $'
  15. crlflf  Db      13,10,10,'$'
  16.  
  17. got_1   Db    13,10,'Another (supposedly) compatible driver has already been loaded!',13,10,'$'
  18.  
  19. bad_1   Db    13,10,'Bad return from regular FOSSIL when attempting to install VFOSSIL!',13,10,'$'
  20.  
  21. str2    Db  '(C) Copyright 1988 by Bob Hartman and Spark Software, Inc.',13,10,'$'
  22.  
  23. str3    Db  'Modifications ver A for DESQview by David Page (109/604)',13,10,'$'
  24.  
  25.  
  26. start:                                    ;Initialization code
  27.  
  28.     MOV    DX,OFFSET my_intro      ; print first string
  29.     MOV    AH,9
  30.     INT    21H
  31.     MOV    DX,OFFSET rev_str    ; print first string
  32.     INC    DX
  33.     MOV    AH,9
  34.     INT    21H
  35.     MOV    DX,OFFSET crlflf        ; print cr's and lf's
  36.     MOV    AH,9
  37.     INT    21H
  38.     MOV    DX,OFFSET str2        ; print second string
  39.     MOV    AH,9
  40.     INT    21H
  41.   MOV DX,OFFSET str3    ; print third string
  42.     MOV    AH,9
  43.     INT    21H
  44.         
  45. ;        check if a driver is already present
  46.  
  47.         mov     ah,81h                  ;VFOSSIL application code
  48.         mov     al,0                    ;subfunction 0 to get info
  49.         mov     di,offset vfos_info     ;structure to store info
  50.     push    es                      ;save ES
  51.         push    cs                      ;put CS into
  52.         pop     es                      ;ES
  53.         int     14h                     ;call the function
  54.  
  55.         cmp     ax,1954h                ; was it a proper return?
  56.         je      already_there           ; yes, so just exit
  57.  
  58.         mov     ah,7eh                  ; install application code
  59.         mov     al,81h                  ; VFOSSIL code
  60.         mov     dx,offset vfos_entry    ; offset of entry point (es ok)
  61.         int     14h                     ; initialize it
  62.  
  63.         cmp     ax,1954h                ; good return?
  64.         jne     bad_fossil              ; no, say it was bad
  65.         cmp     bh,1                    ; was it installed
  66.         jne     bad_fossil              ; no, say it was bad
  67.  
  68. ; make sure the table is properly set up (do our own relocation!)
  69.  
  70.         mov     di,offset FUNCTBL       ;* setup FUNCTBL addressing
  71.         mov     ax,cs                   ;* put current code address in
  72.         mov     es,ax                   ;* ES, and starting from 
  73.         add     di,2                    ;* 2 bytes into FUNCTBL
  74.         mov     cx,20                   ;* for 20 functions
  75.  
  76. str_loop:
  77.         stosw                           ;* move CS into the segment
  78.         add     di,2                    ;* part of function address
  79.         loop    str_loop                ;* skipping offset, loop til done
  80.  
  81. ; now set up the base address of the adapter
  82.         mov     ah,0fh         ;* what is video mode function
  83.         int     10h            ;* call bios to find out
  84.         cmp     al,7           ;* is it monochrome?
  85.         jne     env_free       ;* if not, go on
  86.         mov     ax,0b000h      ;* if so, change to mono from
  87.         mov     adapter_base,ax ;* CGA (the default)
  88.  
  89. ; Free our environment memory segment
  90. env_free:
  91.         push    cs            ;* put Code Segment
  92.         pop     ds            ;* into DS, as setup for DOS
  93.         mov     bx,2ch        ;* pointer to environment segment
  94.         mov     ax,[bx]       ;* in PSP, moved to become
  95.         mov     es,ax         ;* segment address to free
  96.         mov     ah,49h        ;* free allocated memory call
  97.         int     21h           ;* to DOS, requires DOS 2.0
  98.  
  99. ;       And finally, terminate but leave resident code
  100. ;       Use the old Int 27 call for DOS 1.x compatability.
  101.  
  102.         pop     es
  103.     mov    dx,offset resend  ;* free up memory used by install
  104.         Int     27H                       ;Use Int 27 for DOS 1.0 Compatability
  105.  
  106. already_there:
  107.         mov     dx,offset got_1       ;* message saying we're here already
  108.         jmp     nogo
  109.  
  110. bad_fossil:
  111.         mov     dx,offset bad_1       ;* message saying FOSSIL bad
  112.  
  113. nogo:
  114.     pop    es
  115.         mov     ah,9                ;print string
  116.         int     21h
  117.         int     20h                 ;terminate ;* normally, no install
  118. code    ends
  119.     end vfos_ibm
  120.  
  121.